<!DOCTYPE html>
<html>

<body>
    <h1>演示如何访问输入按钮</h1>
    <p>触发button</p>
    <input type="button" id="button_start" onclick="js_button_start()" value="button_start" />
    <input type="button" id="button_stop" onclick="js_button_stop()" value="button_stop" />
    <script>
        function js_button_start() {
            var x = document.getElementById("button_start").value;
            var now_time = new Date();
            console.log(x + " " + now_time.toLocaleString());
        }
        function js_button_stop() {
            var x = document.getElementById("button_stop").value;
            var now_time = new Date();
            console.log(x + " " + now_time.toLocaleString());
        }
    </script>
</body>

</html>